package com.pureut.system.api.factory;

import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.system.api.OrderFeignService;
import com.pureut.system.api.domain.CustomerManagement;
import com.pureut.system.api.vo.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 服务降级处理
 * 
 * @author ruoyi
 */
@Component
public class RemoteOrderFallbackFactory implements FallbackFactory<OrderFeignService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteOrderFallbackFactory.class);

    @Override
    public OrderFeignService create(Throwable throwable)
    {
        log.error("订单服务调用失败:{}", throwable.getMessage());
        return new OrderFeignService()
        {

            @Override
            public AjaxResult view(Long id) {
                return null;
            }

            @Override
            public AjaxResult getConverterView(Long id) {
                return null;
            }

            @Override
            public AjaxResult customerView(Long id) {
                return null;
            }

            @Override
            public AjaxResult getDetailById(Long salesOrderId, String materialCode) {
                return null;
            }

            @Override
            public AjaxResult updateOrderData(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {
                return null;
            }

            @Override
            public AjaxResult updateDataByScheduling(UpdateDataBySchedulingVo updateDataBySchedulingVo) {
                return null;
            }

            @Override
            public void updateSaleOrderDetailStatus(UpdateSaleOrderDetailStatusVo updateSaleOrderDetailStatusVo) {

            }

            @Override
            public void backData(BackDataVo backDataVo) {

            }

            @Override
            public boolean updateShippingWeight(BackDataVo backDataVo) {
                return false;
            }

            @Override
            public boolean updateShippingWeightSub(BackDataVo backDataVo) {
                return false;
            }

            @Override
            public boolean updateSalesReturn(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {
                return false;
            }

            @Override
            public boolean updateDeductSalesReturn(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {
                return false;
            }

            @Override
            public boolean updateShippingOutWeight(BackDataVo backDataVo) {
                return false;
            }

            @Override
            public boolean updateShippingWeightSubBack(BackDataVo backDataVo) {
                return false;
            }

            @Override
            public boolean updateSubcontractingOrderData(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo) {
                return false;
            }

            @Override
            public boolean updateSubcontractingOrderDataDelete(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo) {
                return false;
            }

            @Override
            public boolean updateBackOrderData(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo) {
                return false;
            }

            @Override
            public boolean updateBackOrderDataDelete(UpdateSubcontractingOrderDataVo updateSubcontractingOrderDataVo) {
                return false;
            }

            @Override
            public boolean updateSubWeight(BackDataVo backDataVo) {
                return false;
            }

            @Override
            public CustomerManagement getCustomerId(String customerName) {
                return null;
            }

            @Override
            public boolean updateSaleStatus(BackDataVo backDataVo) {
                return false;
            }

            @Override
            public boolean updateSaleDocument(SaleDocumentVo saleDocumentVo) {
                return false;
            }

            @Override
            public boolean updateSubWeightDelete(BackDataVo backDataVo) {
                return false;
            }

        };

    }
}
